# 创建一副扑克牌
cards = []
types = {"红桃":"\u2665","黑桃":"\u2660","梅花":"\u2663","方块":"\u2666"}
tyups1 = {"1":"A","11":"J","12":"Q","13":"K"}
def is_Exist(key):
    for key1 in tyups1.keys():
        if key1==key:
            return True
    return False
def create_cards_by_typr(type):
    for i in range(1,14):
        h = {}
        h["type"] = types[type]
        if is_Exist(str(i)):
            h["value"] =tyups1[str(i)]
        else:
            h["value"] = str(i)
        cards.append(h)

def print_cards():
    for card in cards:
        print(card)
def init_cards():
    create_cards_by_typr("红桃")
    create_cards_by_typr("黑桃")
    create_cards_by_typr("梅花")
    create_cards_by_typr("方块")
def find2():     # 找所有的2
    for cardMap in cards:
        if cardMap["value"] =="2":
            print(cardMap)
def find3():     # 找方块牌
    for cardMap in cards:
        if cardMap['type'] == "\u2666":
            print(cardMap)
# def find4():    # 找jqk
#     for cardMap in cards:
#         if cardMap['value'] == "J" or cardMap['value'] == "Q" or cardMap['value'] == "K":
#             print(cardMap)
def find4():    # 找jqk
    for cardMap in cards:
        if cardMap['value'].isdigit() == False:
            print(cardMap)
def find5():    # 找jqk
    for cardMap in cards:
        if (cardMap['value'] == "J" or cardMap['value'] == "Q" or cardMap['value'] == "K") and cardMap['type']== "\u2665":
            print(cardMap)
init_cards()
find4()